<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <%@ include file="/WEB-INF/page/base/css_common.jsp" %>

    <title>活动管理</title>
</head>

<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 活动管理 <span
        class="c-gray en">&gt;</span> 活动列表<span
        class="c-gray en">&gt;</span> 报名列表 <a class="btn btn-success radius r mr-20"
                                              style="line-height:1.6em;margin-top:3px"
                                              href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
    <%--<shiro:hasPermission name="sys:user:add"> </shiro:hasPermission>--%>
    <%--<div class="cl pd-5 bg-1 bk-gray">--%>
        <%--<span class="l">--%>
            <%--<a class="btn btn-primary radius" href="javascript:;"--%>
               <%--onclick="add_activity('添加活动','${ctx}/activity/toAddActivity','1000','500')"><i class="Hui-iconfont">--%>
                <%--&#xe600;</i> 添加活动</a>--%>
        <%--</span>--%>
    <%--</div>--%>

    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="6">报名列表</th>
        </tr>
        <tr class="text-c">
            <%--<th style="width:18px;padding-right:6px;"><input id='checkall' type='checkbox'--%>
                                                             <%--value='true'/></th>--%>
            <th width="200">姓名</th>
            <th width="200">电话</th>
            <th width="70">公司</th>
            <th width="70">已签到</th>
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${data }" var="d">
            <tr class="text-c">
                <%--<td><input name='ids' type='checkbox' value=${d.id}></td>--%>
                <td>${d.name }</td>
                <td>${d.phont }</td>
                <td>${d.company}</td>
                <td>${d.sign_in==1?"是":"否"}</td>
                    <c:if test="${d.sign_in==0}">
                        <td class="td-manage">
                            <a style="text-decoration:none" onClick="sign_in('${d.id}')" href="javascript:;"
                               title="签到">
                                <i class="Hui-iconfont">&#xe631;</i></a>
                            </a>
                        </td>
                    </c:if>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<%@ include file="/WEB-INF/page/base/common.jsp" %>

<script type="text/javascript">
    $('.table-sort').dataTable({
        "aaSorting": [[1, "desc"]],//默认第几个排序
        "bStateSave": true,//状态保存
        "aoColumnDefs": [
            //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
            {"orderable": false, "aTargets": [0, 8]}// 制定列不参与排序
        ]
    });


    $(function () {
        $('#checkall').click(function () {
            var items = document.getElementsByName('ids');
            for (var i = 0; i < items.length; i++) {
                items[i].checked = this.checked;
            }
        });
    })
    function sign_in(id) {
        $.ajax({
            url: "${ctx}/sign/signIn/" + id,
            type: 'post',
            data: null,
            success: function (data) {
                window.location.reload();
            }
        })
    }

</script>
</body>
</html>
